/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.me.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Jayasundara
 */
@Entity
@Table(name = "name_prefix", catalog = "postgres", schema = "public")
@NamedQueries({@NamedQuery(name = "NamePrefix.findAll", query = "SELECT n FROM NamePrefix n"), @NamedQuery(name = "NamePrefix.findById", query = "SELECT n FROM NamePrefix n WHERE n.id = :id"), @NamedQuery(name = "NamePrefix.findByPrefix", query = "SELECT n FROM NamePrefix n WHERE n.prefix = :prefix"), @NamedQuery(name = "NamePrefix.findByDescription", query = "SELECT n FROM NamePrefix n WHERE n.description = :description")})
public class NamePrefix implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id", nullable = false)
    private Integer id;
    @Column(name = "prefix", length = 10)
    private String prefix;
    @Column(name = "description", length = 25)
    private String description;
    @OneToMany(mappedBy = "defaultAssignee")
    private List<Project> projectCollection;
    @OneToMany(mappedBy = "prefixId")
    private List<User> userCollection;
    @OneToMany(mappedBy = "roleId")
    private List<User> userCollection1;

    public NamePrefix() {
    }

    public NamePrefix(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getPrefix() {
        return prefix;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public List<Project> getProjectCollection() {
        return projectCollection;
    }

    public void setProjectCollection(List<Project> projectCollection) {
        this.projectCollection = projectCollection;
    }

    public List<User> getUserCollection() {
        return userCollection;
    }

    public void setUserCollection(List<User> userCollection) {
        this.userCollection = userCollection;
    }

    public List<User> getUserCollection1() {
        return userCollection1;
    }

    public void setUserCollection1(List<User> userCollection1) {
        this.userCollection1 = userCollection1;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NamePrefix)) {
            return false;
        }
        NamePrefix other = (NamePrefix) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.me.entity.NamePrefix[id=" + id + "]";
    }

}
